package com.example.leonard.common.enums;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public enum TestEnum {
    test("testCOED","测试")
    ;
    private String code;
    private String msg;

    TestEnum(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public String getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    public static void main(String[] args) {
        Logger logger = LoggerFactory.getLogger(args.getClass());
        try {
            System.out.println(TestEnum.test.getCode());
            throw new RuntimeException("抛出异常信息");
        }catch (Exception e){
            logger.error(e.getMessage(),e);
        }
    }
}
